<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Files Uploader</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
    Folder Uploader<br>
    @author: wangyunkun<br>
    @description: select a folder, and all files under the directory will be uploaded to server.<br>
    @note: empty folder will not be uploaded.<br>
    <form action="/uploadFolder" method="post" enctype="multipart/form-data">
      <input id="folder" type="file" name="folder" multiple webkitdirectory>
      <button type="submit">上传</button>
    </form>
    <script type="text/javascript">
        function uploadFiles(){
            $.post("/uploadFolder",{
                folder: $("#folder")
            },function(result){
                if(result=="success"){
                    alert("success");
                    location.reload();
                }else{
                    alert("failed");
                }
            })
        }
    </script>
</body>
</html>